package com.demo.pojo;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class Zone {
    String id;
    String name;
    String parentId;
    String orderBy;
    List<Zone> children;

    public Zone(String id, String name, String parentId,String orderBy) {
        this.id = id;
        this.name = name;
        this.parentId = parentId;
        this.orderBy = orderBy;
    }

    public Zone() {

    }

    public void addChildren(Zone zone){
        if(children == null) {
            children = new ArrayList<>();
        }
        children.add(zone);
    }
}

